package com.example.demo.servlet;

import com.example.demo.bean.Position;
import com.google.gson.Gson;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.SocketException;
import java.util.Timer;
import java.util.TimerTask;

/**
 * @ClassName: RunnableTask
 * @Description:
 * @Author: 12071
 * @Date: 2021/6/29 20:23
 */
public class ThreadTask extends Thread {

    String str="fweagfw";

    @Override
    public void run() {

        System.out.println("线程启动");
        new Timer("task-fda").schedule(new TimerTask() {
            @Override
            public void run() {
                long l = System.currentTimeMillis();
                System.out.println(str + l);
            }
        },2000);

    }
}
